<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2016/6/6
 * Time: 11:02
 */

namespace app\common\model;



use think\Model;

class Comment extends Model
{
    const DELETED = 1,         //删除
        NOT_DELETED = 0;       //未删除
    protected $pk = 'id';
    protected $autoWriteTimestamp = true;
    // 定义时间戳字段名
    protected $createTime = 'ctime';
    protected $updateTime = null;
    public function user(){
        return $this->hasOne('User','id','uid');
    }
    public function parent(){
        return $this->hasOne('Comment','id','pid');
    }
}